package com.netstar.ui.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;

import com.netstar.R;

/***
 * 申请免费流量最后一步界面
 * 
 * @author taona
 * 
 */
public class ApplyOverActivity extends Activity implements OnClickListener {
	private Button apply_free_back;
	private ImageView free_game_state;
	private ImageView free_app_state;
	private ImageView free_mtv_state;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// 设置全屏
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

		setContentView(R.layout.apply_flow_over);

		initView();
		apply_free_back.setOnClickListener(this);
		free_game_state.setOnClickListener(this);
		free_app_state.setOnClickListener(this);
		free_mtv_state.setOnClickListener(this);
	}

	/**
	 * 初始化控件
	 */
	public void initView() {
		apply_free_back = (Button) findViewById(R.id.btn_title_left);
		free_game_state = (ImageView) findViewById(R.id.free_game_state);
		free_app_state = (ImageView) findViewById(R.id.free_app_state);
		free_mtv_state = (ImageView) findViewById(R.id.free_mtv_state);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent;
		switch (v.getId()) {
			case R.id.btn_title_left:
				intent = new Intent(ApplyOverActivity.this, NetStarActivity.class);
				startActivity(intent);
				break;
			case R.id.free_game_state:
				intent = new Intent(ApplyOverActivity.this, MtvActivity.class);
				intent.putExtra("save", "game");
				startActivity(intent);
				break;
			case R.id.free_app_state:
				intent = new Intent(ApplyOverActivity.this, MtvActivity.class);
				intent.putExtra("save", "app");
				startActivity(intent);
				break;
			case R.id.free_mtv_state:
				intent = new Intent(ApplyOverActivity.this, MtvActivity.class);
				intent.putExtra("save", "mtv");
				startActivity(intent);
				break;
		}
	}
}
